home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Utilities / BackSpace / Source / PanelImageView.m < prev    next >
Text File  |  1993-07-14  |  933b  |  51 lines

  1. //  PanelImageView.m
  2. //  implements the view that places an image in BackSpace's image inspector.
  3. //
  4. //  You may freely copy, distribute, and reuse the code in this example.
  5. //  NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  6. //  fitness for any particular use.
  7.  
  8.  
  9. #import "PanelImageView.h"
  10. #import <dpsclient/wraps.h>
  11. #import <appkit/graphics.h>
  12. #import <appkit/NXImage.h>
  13.  
  14. @implementation PanelImageView
  15.  
  16. - setImage: anImage
  17. {
  18.     image = anImage;
  19.     return self;
  20. }
  21.  
  22. - image
  23. {
  24.     return image;
  25. }
  26.  
  27. - drawSelf: (const NXRect *) rects: (int) rectCount
  28. {
  29.     BOOL wasScalable;
  30.     NXSize wasSize;
  31.  
  32.  
  33.     PSsetgray(0);
  34.     NXRectFill(rects);
  35.     if (image)
  36.     {
  37.         wasScalable = [image isScalable];
  38.         [image getSize: &wasSize];
  39.  
  40.         [image setScalable: YES];
  41.         [image setSize: &rects->size];
  42.         [image composite: NX_SOVER toPoint: &rects->origin];
  43.         [image setScalable: wasScalable];
  44.         [image setSize: &wasSize];
  45.     }
  46.  
  47.     return self;
  48. }
  49.  
  50. @end
  51.